{{include file="Manage/header.html"}}
<!--适应手机端-->
<script type="text/javascript" src="{{$smarty.const.__APP__}}manage/js/rem.js"></script>
<body>
{{include file="Manage/menu.html"}}
<div class="pro_detail">
    <div class="project">
        <div class="center">
            <p>{{$project.project}}</p>
            <div class="address">
                <span>广东省</span>茂名市
            </div>
            <div class="field">
                {{foreach from=$project.field item=val key=key}}
                <span>{{$val}}</span>
                {{/foreach}}

            </div>
        </div>
    </div>
    <ul class="menu" id="menu">
        <div class="center">
            <li class="curr"><a href="#project_info">项目信息</a></li>
            <li><a href="#team">团队信息</a></li>
            {{if $result.type != '1'}}<li><a href="#result">审核信息</a></li>{{/if}}
        </div>
    </ul>
    <div class="menu_detail">
        <div class="center">
            <div class="project_info" id="project_info">
                <div class="title">
                    <img src="{{$smarty.const.__APP__}}manage/images/project1.png">项目信息
                </div>
                <ul>
                    <li>
                        <div>负责人简介</div>
                        <p>
                            {{$project.params.personal}}
                        </p>
                    </li>
                    <li>
                        <div>项目概述</div>
                        <p>
                            {{$project.params.descride}}
                        </p>
                    </li>
                    <li>
                        <div>项目进展</div>
                    </li>
                    <li>
                        <div>项目附件</div>
                        <div class="file">
                            <img src="{{$smarty.const.__APP__}}manage/images/report.png">
                            <span>项目计划书</span>
                            <a href="{{$smarty.const.__PUB__}}{{$project.files}}">下载</a>
                        </div>
                    </li>
                    <!--<li>-->
                        <!--<div>审核结果</div>-->
                        <!--<div class="examine">-->
                            <!--<textarea placeholder="内容选填，可给予项目建议或者项目审核不通过的理由"></textarea>-->
                            <!--<button>审核通过</button>-->
                            <!--<button>审核不通过</button>-->
                        <!--</div>-->
                    <!--</li>-->
                </ul>
            </div>
            <div class="team" id="team">
                <div class="title">
                    <img src="{{$smarty.const.__APP__}}manage/images/team.png">团队信息
                </div>
                <ul>
                    <li>
                        <div>团队成员</div>
                        <table>
                            <tr>
                                <th>姓名</th>
                                <!--<th>性别</th>-->
                                <th>团队角色</th>
                                <!--<th>学院</th>-->
                                <!--<th>专业</th>-->
                                <!--<th>工作</th>-->
                            </tr>
                            {{if $project.members}}
                            {{foreach from=$project.members.student item=val key=key}}
                            <tr>
                                <td>{{$val.0}}</td>
                                <!--<td>男</td>-->
                                <td>团队成员</td>
                                <!--<td>电信学院</td>-->
                                <!--<td>自动化15</td>-->
                                <!--<td>项目工作的安排及进度的监督</td>-->
                            </tr>
                            {{/foreach}}
                            {{/if}}
                            <!--<tr>-->
                                <!--<td>许蔚佳</td>-->
                                <!--&lt;!&ndash;<td>男</td>&ndash;&gt;-->
                                <!--<td>项目创始人</td>-->
                                <!--&lt;!&ndash;<td>电信学院</td>&ndash;&gt;-->
                                <!--&lt;!&ndash;<td>自动化15</td>&ndash;&gt;-->
                                <!--&lt;!&ndash;<td>项目工作的安排及进度的监督</td>&ndash;&gt;-->
                            <!--</tr>-->
                        </table>
                    </li>
                    <li>
                        <div>指导老师</div>
                    </li>
                </ul>
            </div>
            {{if $result.type != '1'}}
            <form method="post" onsubmit="return false">
                <input type="hidden" name="id" value="{{$project.id}}">
                <input type="hidden" name="parent_id" value="{{$project.parent_id}}">
                <input type="hidden" name="project" value="{{$project.project}}">
                <div class="result" id="result">
                    <div class="title">
                        <img src="{{$smarty.const.__APP__}}manage/images/result.png">审核信息
                    </div>
                    <ul>
                        <li>
                            <div>推荐给</div>
                            <div class="sel">
                                <select data-placeholder="请选择老师" class="chosen-select" multiple tabindex="4" name="teacher[]">
                                    <option value=""></option>
                                    {{if $teacher}}
                                    {{foreach from=$teacher item=val}}
                                    <option value="{{$val.id}}" {{foreach from=$project.teacher item=val2}} {{if $val2 == $val.id}}selected="true"{{/if}}{{/foreach}}>{{$val.username}}</option>
                                    {{/foreach}}
                                    {{/if}}
                                </select>
                            </div>
                        </li>
                        <li>
                            <div>审核建议</div>
                            <ul class="dowebok">
                                <li><input type="radio" name="auditing" data-labelauty="暂不审核" value="0" {{if $project.auditing_1 == '0'}}checked{{elseif $project.auditing_2 == '0'}}checked{{/if}}></li>
                                <li><input type="radio" name="auditing" data-labelauty="审核通过" {{if $result.type != '3' && $project.auditing_1 == '1'}}checked{{elseif $result.type == '3' && $project.auditing_2 == '1'}}checked{{/if}} value="1"></li>
                                <li><input type="radio" name="auditing" data-labelauty="审核不通过" {{if $result.type != '3' && $project.auditing_1 == '2'}}checked{{elseif $result.type == '3' && $project.auditing_2 == '2'}}checked{{/if}} value="2"></li>
                            </ul>
                            <div class="examine">
                                <textarea placeholder="内容选填，可给予项目建议或者项目审核不通过的理由" id="txt" name="content"></textarea>
                                <div class="limit"><span id="word">150</span>/150</div>
                            </div>
                            <button onclick="submit_content()">确定</button>
                        </li>
                    </ul>
                </div>
            </form>
            {{/if}}
        </div>
    </div>
</div>
<script src="{{$smarty.const.__APP__}}manage/js/chosen.jquery.js" type="text/javascript"></script>
<script src="{{$smarty.const.__APP__}}manage/js/prism.js" type="text/javascript" charset="utf-8"></script>
<script src="{{$smarty.const.__APP__}}manage/js/init.js" type="text/javascript" charset="utf-8"></script>
<script src="{{$smarty.const.__APP__}}manage/js/jquery-labelauty.js"></script>
<script>
    $(function () {
        var  menu_top = $("#menu").offset().top;
        var  team_top = $("#team").offset().top;

        $(window).scroll(function(){
            var scroH = $(this).scrollTop();
            if(scroH>=menu_top){
                $(".menu").css({"position":"fixed","top":0});
            }else if(scroH<menu_top){
                $(".menu").css({"position":"static"});
            }
        })

        $(".menu li").click(function(){
            $(this).addClass("curr").siblings().removeClass("curr");
        });

        $(':input').labelauty();

        $("textarea").focus(function(){
            $(this).css("box-shadow","0 0 5px rgba(0, 0, 0, 0.3)");
        });
        $("textarea").blur(function(){
            $(this).css("box-shadow","none");
        });

        $("#txt").keyup(function(){
            if($("#txt").val().length > 150){
                $("#txt").val( $("#txt").val().substring(0,150) );
            }
            $("#word").text( 150 - $("#txt").val().length ) ;
        });
    })

    function submit_content(){
        var params = $("form").serialize();

        ui.confirm('确定要提交您的审核结果吗?',function(z){
            if(z){
                $.post('{{"index.php?app=Myproject&act=teacher_verify"|URL}}',params,function(result){
                    if(result.statusCode=='200'){
                        ui.success('操作成功，正在返回页面！');
                        setTimeout(function(){
                            self.location=document.referrer;//返回上一页并刷新
                        },1000);
                    }else if(result.statusCode=='300'){
                        ui.error(result.message);
                    }
                },'json');
            }
        },true);

    }
</script>
{{include file="Manage/footer.html"}}